<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Creative Evolution Tools: /Users/pjh/Desktop/Work/Teaching/CreativeEvolutionCourse/core/include/genetic/PolynomialData.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Creative Evolution Tools
   &#160;<span id="projectnumber">0.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_4270bfced15e0e73154b13468c7c9ad9.html">core</a></li><li class="navelem"><a class="el" href="dir_24d671cfcbc5d5238a6bd565a49d198f.html">include</a></li><li class="navelem"><a class="el" href="dir_3c54a2e38037f196c9fae2a74e021b71.html">genetic</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">PolynomialData.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">/*         Evolution as a Creative Tool         */</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">/*           Taught by Patrick Hebron           */</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">/* Interactive Telecommunications Program (ITP) */</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">/*             New York University              */</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">/*                  Fall 2013                   */</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &quot;GuiPlot.h&quot;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keyword">typedef</span> std::shared_ptr&lt;class PolynomialData&gt;   PolynomialDataRef;          </div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keyword">typedef</span> std::vector&lt;PolynomialDataRef&gt;          PolynomialDataRefVec;       </div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="keyword">typedef</span> PolynomialDataRefVec::iterator          PolynomialDataRefVecIter;   </div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="keyword">typedef</span> PolynomialDataRefVec::reverse_iterator  PolynomialDataRefVecRiter;  </div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="keyword">typedef</span> PolynomialDataRefVec::const_iterator    PolynomialDataRefVecCiter;  </div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="code" href="class_polynomial_data.html">   22</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_polynomial_data.html" title="A class representing a polynomial function.">PolynomialData</a> :<span class="keyword">public</span> <a class="code" href="class_plotter_data.html" title="Base class representing data to be plotted by GuiPlot.">PlotterData</a> {</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    </div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="code" href="class_polynomial_data.html#aa51d94a0bfb9c8a6a22b6f42bc876b86">   25</a></span>&#160;    <span class="keyword">typedef</span> std::pair&lt;float,float&gt;          <a class="code" href="class_polynomial_data.html#aa51d94a0bfb9c8a6a22b6f42bc876b86" title="A &lt;Coefficient,Exponent&gt; pair.">ComponentPair</a>;      </div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="code" href="class_polynomial_data.html#aa29043ac29b9eefb530b6671be625814">   26</a></span>&#160;    <span class="keyword">typedef</span> std::vector&lt;ComponentPair&gt;      <a class="code" href="class_polynomial_data.html#aa29043ac29b9eefb530b6671be625814" title="A vector of &lt;Coefficient,Exponent&gt; pairs.">ComponentVec</a>;       </div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="code" href="class_polynomial_data.html#a5ae869760aeed6d622bd0229b8eb8d76">   27</a></span>&#160;    <span class="keyword">typedef</span> ComponentVec::iterator          <a class="code" href="class_polynomial_data.html#a5ae869760aeed6d622bd0229b8eb8d76" title="An iterator type for a vector of &lt;Coefficient,Exponent&gt; pairs.">ComponentVecIter</a>;   </div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="code" href="class_polynomial_data.html#a82be1374bb854aca018846d21094125e">   28</a></span>&#160;    <span class="keyword">typedef</span> ComponentVec::reverse_iterator  <a class="code" href="class_polynomial_data.html#a82be1374bb854aca018846d21094125e" title="A reverse iterator type for a vector of &lt;Coefficient,Exponent&gt; pairs.">ComponentVecRiter</a>;  </div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="code" href="class_polynomial_data.html#a7f77c4a643aa4b9fde19201969f8d787">   29</a></span>&#160;    <span class="keyword">typedef</span> ComponentVec::const_iterator    <a class="code" href="class_polynomial_data.html#a7f77c4a643aa4b9fde19201969f8d787" title="A const iterator type for a vector of &lt;Coefficient,Exponent&gt; pairs.">ComponentVecCiter</a>;  </div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    </div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    </div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="code" href="class_polynomial_data.html#aa2a30c7dffdb123c572ad60b3af70f51">   33</a></span>&#160;    <a class="code" href="class_polynomial_data.html#aa29043ac29b9eefb530b6671be625814" title="A vector of &lt;Coefficient,Exponent&gt; pairs.">ComponentVec</a>    <a class="code" href="class_polynomial_data.html#aa2a30c7dffdb123c572ad60b3af70f51" title="The formula&#39;s components.">mComponents</a>;    </div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    </div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="code" href="class_polynomial_data.html#af989f08bb8d62cd2ed704eb44f9b3adf">   35</a></span>&#160;    <span class="keywordtype">size_t</span>          <a class="code" href="class_polynomial_data.html#af989f08bb8d62cd2ed704eb44f9b3adf" title="The number of samples to be plotted.">mDrawSamples</a>;   </div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="code" href="class_polynomial_data.html#a5190d5ec249c05a426080991d357e40f">   36</a></span>&#160;    <span class="keywordtype">float</span>           <a class="code" href="class_polynomial_data.html#a5190d5ec249c05a426080991d357e40f" title="The beginning of the param range.">mDrawRangeIn</a>;   </div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="code" href="class_polynomial_data.html#abff5e934de5f2cc78876e2da2f0867f1">   37</a></span>&#160;    <span class="keywordtype">float</span>           <a class="code" href="class_polynomial_data.html#abff5e934de5f2cc78876e2da2f0867f1" title="The end of the param range.">mDrawRangeOut</a>;  </div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="code" href="class_polynomial_data.html#ace6de172472e4b95b76d13dd21f999da">   38</a></span>&#160;    <span class="keywordtype">bool</span>            <a class="code" href="class_polynomial_data.html#ace6de172472e4b95b76d13dd21f999da" title="Flags whether formula data should be drawn.">mDrawFormula</a>;   </div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="class_polynomial_data.html#a665a958ff21bf9969f842eb95818e891">   39</a></span>&#160;    <span class="keywordtype">bool</span>            <a class="code" href="class_polynomial_data.html#a665a958ff21bf9969f842eb95818e891" title="Flags whether derivative data should be drawn.">mDrawDeriv</a>;     </div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="code" href="class_polynomial_data.html#a278f68eb6b129f4635dd5bdbeef62ff6">   40</a></span>&#160;    <span class="keywordtype">bool</span>            <a class="code" href="class_polynomial_data.html#a278f68eb6b129f4635dd5bdbeef62ff6" title="Flags whether raster data needs updating.">mDirty</a>;         </div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    </div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    </div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    <a class="code" href="class_polynomial_data.html#a2daf3355859ebb0886433ceab3276a7f" title="Basic Constructor.">PolynomialData</a>(<span class="keyword">const</span> <span class="keywordtype">float</span>&amp; iParamIn = 0.0, <span class="keyword">const</span> <span class="keywordtype">float</span> &amp;iParamOut = 1.0,</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;                   <span class="keyword">const</span> <span class="keywordtype">bool</span>&amp; iDrawFormula = <span class="keyword">true</span>, <span class="keyword">const</span> <span class="keywordtype">bool</span>&amp; iDrawDeriv = <span class="keyword">true</span>,</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;                   <span class="keyword">const</span> ci::ColorA&amp; iColor = ci::ColorA::white(), <span class="keyword">const</span> <span class="keywordtype">float</span>&amp; iStrokeWeight = 3.0);</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="class_polynomial_data.html#ae89bd56d2a8c7237b4688b4139f994cf" title="Virtual destructor.">~PolynomialData</a>();</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    </div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="class_plotter_data.html" title="Base class representing data to be plotted by GuiPlot.">PlotterData</a>*    <a class="code" href="class_polynomial_data.html#ae6d60ae0791f477e4fd59d6694a38c2e" title="Returns a clone of this item.">clone</a>();</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span>            <a class="code" href="class_polynomial_data.html#ad47bf7c086d64fef6c01e5542f47da79" title="An overloadable draw method.">draw</a>();</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    </div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="keywordtype">void</span>                    <a class="code" href="class_polynomial_data.html#addcf3ab3c6147919c43f44dd9af97db7" title="Sets the parameter range for the drawing of the polynomial formula.">setDrawParameters</a>(<span class="keyword">const</span> <span class="keywordtype">float</span>&amp; iParamIn, <span class="keyword">const</span> <span class="keywordtype">float</span>&amp; iParamOut,</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;                                              <span class="keyword">const</span> <span class="keywordtype">bool</span>&amp; iDrawFormula = <span class="keyword">true</span>, <span class="keyword">const</span> <span class="keywordtype">bool</span>&amp; iDrawDeriv = <span class="keyword">true</span>,</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;                                              <span class="keyword">const</span> ci::ColorA&amp; iColor = ci::ColorA::white(), <span class="keyword">const</span> <span class="keywordtype">float</span>&amp; iStrokeWeight = 3.0);</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    </div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keywordtype">void</span>                    <a class="code" href="class_polynomial_data.html#a67c459e29c65ea79be11c6b9a209c6f8" title="Adds a component with the given coefficient and exponent values to the formula.">addComponent</a>(<span class="keyword">const</span> <span class="keywordtype">float</span>&amp; iCoeff, <span class="keyword">const</span> <span class="keywordtype">float</span>&amp; iExpon);</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    </div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <a class="code" href="class_polynomial_data.html#aa29043ac29b9eefb530b6671be625814" title="A vector of &lt;Coefficient,Exponent&gt; pairs.">ComponentVec</a>&amp;           <a class="code" href="class_polynomial_data.html#ac2e4d723d0cde539326924933d34672a" title="Returns a reference to the components vector.">getComponents</a>();</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    </div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keyword">const</span> <a class="code" href="class_polynomial_data.html#aa29043ac29b9eefb530b6671be625814" title="A vector of &lt;Coefficient,Exponent&gt; pairs.">ComponentVec</a>&amp;     <a class="code" href="class_polynomial_data.html#ac2e4d723d0cde539326924933d34672a" title="Returns a reference to the components vector.">getComponents</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    </div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keywordtype">float</span>                   <a class="code" href="class_polynomial_data.html#ab04af5acc429792d65564a05b677aac1" title="Computes the output value for a given input.">getValue</a>(<span class="keyword">const</span> <span class="keywordtype">float</span>&amp; iParam) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    </div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="keywordtype">float</span>                   <a class="code" href="class_polynomial_data.html#a8a5e239056596df41ff680e553b04f78" title="Computes the derivative of the output value for a given input.">getDerivativeValue</a>(<span class="keyword">const</span> <span class="keywordtype">float</span>&amp; iParam) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    std::string             <a class="code" href="class_polynomial_data.html#a5ef4f78a9e1e486ada0c97876a81c346" title="Returns a textual representation of the formula.">getFormulaString</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    </div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    std::string             <a class="code" href="class_polynomial_data.html#a245b3a198847a4f393e9017f428bb52b" title="Returns a textual representation of the derivative formula.">getDerivativeFormulaString</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;};</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Nov 4 2013 15:38:37 for Creative Evolution Tools by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.3.1
</small></address>
</body>
</html>
